package com.fandy.struts.SqlStatement;

public class Entry {
 
	public   String  getAll()
	{
		return   "select * from Entry";
	}
	
	public   String getEntryInfoByID(int ID)
	{
		return  "select * from Entry where " +com.fandy.struts.Meta.Entry.getEntryid()+"="+ID;
	}
	
	
	public   String  existEntry(com.fandy.struts.Model.Entry e)
	{
		return  "select count(*) from Entry where "
		+ com.fandy.struts.Meta.Entry.getEntryid() + "="
		+e.getEntryid();
	
	}
	
	public String UpdateByID(int id,com.fandy.struts.Model.Entry e)
	{
		
		return "update Entry set "+com.fandy.struts.Meta.Entry.getDate()
		+"='" + e.getDate()+"',"		 
		+com.fandy.struts.Meta.Entry.getDepartmentid()+"='" +e.getDepartmentid()+"',"
		
		+com.fandy.struts.Meta.Entry.getGoodsid()+ "='"  + e.getGoodsid() + "',"
		+com.fandy.struts.Meta.Entry.getPrice() + "='"  + e.getPrice() + "',"
		+com.fandy.struts.Meta.Entry.getProvisionid() + "='"  + e.getProvisionid() + "',"
		+com.fandy.struts.Meta.Entry.getQuantity() + "='"  + e.getQuantity()+ "'"		
		+com.fandy.struts.Meta.Entry.getStaffid() + "='"  + e.getStaffid()+ "'"
		+"where "+com.fandy.struts.Meta.Entry.getEntryid()+"="+id;
		
	}
	
	public String DeleteByID(int id)
	{
		
		return "delete from Entry where " + com.fandy.struts.Meta.Entry.getEntryid() +"="+id;
		
	}
	
	
	
}

